#include "StdAfx.h"
#include "SpeakWords.h"

CSpeakWords::CSpeakWords(void)
{
	m_line = 0;
}

CSpeakWords::~CSpeakWords(void)
{
}

void CSpeakWords::LoadSaying(const TSRING &fileName)
{
	std::fstream file(fileName);
	file.getline();	
}

void CSpeakWords::SetMe(const TSTRING &me)
{
	m_me = me;
}

void CSpeakWords::SetU(const TSTRING &u)
{
	m_u = u;
}

LPCTSTR CSpeakWords::GetRandWord()
{
	srand(time(0));
	int line = rand() % m_words.size();
	return m_words[line].c_str();
}

LPCTSTR CSpeakWords::GetLoopWord()
{
	if ( m_words.size() == 0 )
		return NULL;

	m_line++;
	if ( m_line >= m_words.size() )
		m_line = 0;

	return m_words[line].c_str();
}